<?php include(TPL_PATH . '/admin/inc_header.php'); ?>
<?php include(TPL_PATH . '/admin/inc_top.php'); ?>

<script type="text/javascript">
$(document).ready(function() {
	$('input[type=text]').tooltip({'placement':'right'});
});
function do_clean(id) {
	if (confirm('删除后不可还原,确定删除吗?')) {
		window.location.href = '<?php p(HTTP_URL) ?>/index.php?m=admin&c=cat&a=clean&id=' + id;
	}
}
</script>

<form action="<?php p(HTTP_URL); ?>/index.php?m=admin&c=cat&a=<?php if ($blnAdd) { ?>add<?php } else { ?>edit&id=<?php p($id); } ?>" method="post">
    <fieldset>
    	<legend>栏目<?php (!$blnAdd) && p(' - ' . $arrData['name']) ?></legend>
    	
    	<?php if (!empty($strMsg)) { ?>
		<div class="alert alert-error">
			<button type="button" class="close" data-dismiss="alert">&times;</button>
			<?php p($strMsg) ?>
		</div>
		<?php } elseif (!empty($strOk)) { ?>
    	<div class="alert alert-success">
			<button type="button" class="close" data-dismiss="alert">&times;</button>
			<?php p($strOk) ?>
		</div>
    	<?php } ?>
    	
    	<label for="id_parent_id">父级栏目</label>
    	<?php p($objTreeList->getSelect('parent_id', (isset($arrData['parent_id']) ? $arrData['parent_id'] : 0), false, 'class="input-xxlarge"', array(0, '≡ 作为顶级栏目 ≡'))) ?>
    	<label for="id_name">栏目名  / 英文名</label>
    	<input type="text" name="name" id="id_name" value="<?php p($arrData['name']) ?>" title="必填项" /> /
    	<input type="text" name="name_en" id="id_name_en" value="<?php p($arrData['name_en']) ?>" title="必填项,字母或数字组成!" />
        <label for="id_seo_t">SEO Title</label>
    	<input type="text" class="input-xxlarge" name="seo_t" id="id_seo_t" value="<?php p($arrData['seo_t']) ?>" title="80字以内" />
    	<label for="id_seo_k">SEO Keyword</label>
    	<input type="text" class="input-xxlarge" name="seo_k" id="id_seo_k" value="<?php p($arrData['seo_k']) ?>" title="80字以内" />
    	<label for="id_seo_d">SEO Description</label>
    	<textarea name="seo_d" class="input-xxlarge" id="id_seo_d"><?php p($arrData['seo_d']) ?></textarea>
    	<?php if (!$blnAdd) { ?>
        <label class="checkbox">
            <input name="rec_status" type="checkbox" <?php if ($arrData['rec_status']) { ?>checked="checked"<?php } ?> value="1" /> 可用状态
        </label>
        <?php } ?>
        <br />
        <input type="submit" class="btn btn-primary" name="sub_btn" value="保存修改" />
        <?php if (!$blnAdd) { ?>
        <a class="btn btn-danger" href="javascript:do_clean(<?php p($id) ?>);">删除</a>
        <?php } ?>
        <a href="<?php p(HTTP_URL) ?>/index.php?m=admin&c=cat" class="btn">返回列表</a>
    </fieldset>
</form>

<?php include(TPL_PATH . '/admin/inc_bottom.php'); ?>
<?php include(TPL_PATH . '/admin/inc_footer.php'); ?>